package cn.kgc.service.impl;    /*
 *@author wangchangsheng
 *@Date 2023/4/27
 */

import cn.kgc.bean.pojo.EpDepartment;
import cn.kgc.mapper.EpDepartmentMapper;
import cn.kgc.service.EpDepartmentService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;


@Service("epDepartmentService")
public class EpDepartmentServiceimpl implements EpDepartmentService {


    @Resource
    private EpDepartmentMapper epDepartmentMapper;


    /*
     *@author wangchangsheng
     *@Date 2023/4/27
     * 部门录入与概况(分页查询)
     */
    @Override
    public List<EpDepartment> getAllInfoEpDepartment() {
        return epDepartmentMapper.getAllInfoEpDepartment();
    }

    /*
     *@author wangchangsheng
     *@Date 2023/5/10
     * 部门录入与概况(动态获取部门名称)
     */
    @Override
    public List<String> getEpDepartmentDepName() {
        return epDepartmentMapper.getEpDepartmentDepName();
    }

    /*
     *@author wangchangsheng
     *@Date 2023/4/27
     * 部门录入与概况(动态获取部门ID)
     */
    @Override
    public EpDepartment getIdEpDepartment() {
        return epDepartmentMapper.getIdEpDepartment();
    }


    /*
     *@author wangchangsheng
     *@Date 2023/4/27
     * 部门录入与概况(部门录入)
     */
    @Override
    public boolean addEpDepartment(EpDepartment epDepartment) {
        int count = epDepartmentMapper.addEpDepartment(epDepartment);
        if (count>0){
            return true;
        }else {
            return false;
        }
    }

    /*
     *@author wangchangsheng
     *@Date 2023/4/28
     * 部门录入与概况(修改信息)
     */
    @Override
    public boolean updateEpDepartment(EpDepartment epDepartment) {
        int count = epDepartmentMapper.updateEpDepartment(epDepartment);
        if (count>0){
            return true;
        }else {
            return false;
        }
    }
    /*
     *@author wangchangsheng
     *@Date 2023/4/28
     * 部门录入与概况(部门删除)
     */

    @Override
    public boolean delEpDepartment(long id) {
        int count = epDepartmentMapper.delEpDepartment(id);
        if (count>0){
            return true;
        }else {
            return false;
        }
    }
}
